package com.vue.power.backend.config.interceptor;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 类描述：实现拦截器
 */
@Component
public class BackEndInterceptor implements HandlerInterceptor {

    //在请求处理之前进行调用（Controller方法调用之前
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception {
        System.out.println("request.getRequestURI()=>"+request.getRequestURI());
        System.out.println("request.getRequestURL()=>"+request.getRequestURL());
        return true;    //如果false，停止流程，api被拦截
    }

}
